<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName"
           value="${message(code: 'workflowInstanceUser.label', default: 'workflowInstanceUser')}"/>

    <title>编辑工作流权限</title>
</head>

<body>

<div class="main-body">
    <div class="page-wrapper">
        <!-- Page-header start -->
        <div class="page-header">
            <div class="page-header-title">
                <h4>编辑工作流权限</h4>
            </div>

            <div class="page-header-breadcrumb">
                <ul class="breadcrumb-title">
                    <li class="breadcrumb-item">
                        <a href="/salesDashboard/index">
                            <i class="icofont icofont-home"></i>
                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <g:link controller="workflowInstanceStage" action="show"
                                id="${this.workflowInstanceUser?.stage?.id}">工作流阶段</g:link>
                    </li>
                    <li class="breadcrumb-item"><a href="#!">编辑工作流权限</a>
                    </li>
                </ul>
            </div>
        </div>
        <!-- Page-header end -->
        <!-- Page-body start -->
        <div class="page-body">

            <g:if test="${flash.message}">
                <div class="message alert alert-info" role="status">${flash.message}
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                            aria-hidden="true">×</span></button>
                </div>
            </g:if>
            <g:hasErrors bean="${this.workflowInstanceUser}">
                <ul class="errors" role="alert">
                    <g:eachError bean="${this.workflowInstanceUser}" var="error">
                        <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message
                                error="${error}"/></li>
                    </g:eachError>
                </ul>
            </g:hasErrors>
        <!-- Hover table card start -->
            <div class="card">
                <div class="card-header">
                    <h5>编辑工作流权限</h5>

                    <div class="card-header-right">

                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>

                <div class="card-block">
                    <g:form resource="${this.workflowInstanceUser}" method="PUT">

                        <div class="form-group row">
                            <label class="col-md-3 control-label">用户</label>

                            <div class="col-md-4">
                                <input type="hidden" name="stage.id" value="${this.workflowInstanceUser?.stage?.id}">
                                <g:textField class="hidden" name="user.id" id="user" required="required"
                                             value="${this.workflowInstanceUser?.user?.id}"/>
                             <g:textField class="form-control" name="workflowInstanceUsername" required="required"
                             value="${this.workflowInstanceUser?.user}" disabled="disabled"/>

                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-md-3 control-label">权限</label>

                            <div class="col-md-4">
                                <g:select class="form-control" name="authority.id" required="required" id="authority"
                                          value="${this.workflowInstanceUser?.authority?.id}"
                                          from="${com.next.WorkflowAuthority.list()}" optionKey="id"
                                          optionValue="name"></g:select>

                            </div>
                        </div>


                        <div class="form-group row">
                            <div class="col-md-12">
                                <button class="btn btn-info" type="submit">保存</button>
                            </div>
                        </div>
                    </g:form>
                </div>
            </div>
            <!-- Hover table card end -->
        </div>

        <!-- Page-body end -->

    </div>
</div>

</body>

</html>
